import sympy as sp

if __name__ == '__main__':
    # 定义符号变量
    x1, x2, x3, x4, x5, x6 = sp.symbols('a b c d e f')

    # 系数矩阵 A
    coefficients = sp.Matrix([
        [4, 9, 6, 2, 3, 1],
        [4, 25, 10, 2, 5, 1],
        [16, 9, 12, 4, 3, 1],
        [16, 36, 24, 4, 6, 1],
        [36, 9, 18, 6, 3, 1],
        [36, 25, 30, 6, 5, 1]
    ])

    # 常数矩阵 B
    constants = sp.Matrix([2, 4, 4, 6, 5, 7])

    # 解方程组
    solution = sp.solve(coefficients * sp.Matrix([x1, x2, x3, x4, x5, x6]) - constants, [x1, x2, x3, x4, x5, x6])

    print("方程组的解为:", solution)
